(Ext.onReady(function(){
    Ext.create('Ext.form.Panel',{
        width: 400,
        height: 200,
        layout: 'anchor',
        title: 'Form Panel注册',
        bodyPadding: 5,
        defaultType: 'textfield',
        items: [{
            fieldLabel: '用户名',
            name: 'username',
            allowBlank: false
        },{
            fieldLabel: '密码',
            name: 'password',
            allowBlank: false
        },{
            fieldLabel: '确认密码',
            name: 'qrpassword',
            allowBlank: false
        },{
            xtype: 'button',
            text: '重置',
            handler: function(){
                this.up('form').getForm().reset();
            }
        },{
            xtype: 'button',
            text: '提交',
            name: 'submit',
            formBind: true,
            handler: function(){
                var form = this.up('form').getForm();
                if (form.isValid()){
                    form.submit({
                        success: function(form,action) {
                            Ext.Msg.alert('Success',action.result.msg);
                        
                            
                        },
                    });
                }
            }
        }],
        renderTo: Ext.getBody()
    });
}));